﻿/*
 * Copyright © 2020, Wuxi Safover Intelligent Technology Co., Ltd. All rights reserved.
 * 
 * 无锡安永智能科技有限公司版权所有，未经许可，不得用于商业用途
 * 
 * Visit: https://www.safover.com/ 
 */

using log4net;
using System.Diagnostics;

namespace Safover.LidarCollector.Managers
{
    internal class CollectorLog
    {
        internal static void DebugWriteLine(ILog log, string message, LogLevel level = LogLevel.Debug)
        {
            switch (level)
            {
                case LogLevel.All:
                case LogLevel.Debug:
                    log.Debug(message);
                    break;
                case LogLevel.Info:
                    log.Info(message);
                    break;
                case LogLevel.Warn:
                    log.Warn(message);
                    break;
                case LogLevel.Error:
                    log.Error(message);
                    break;
                case LogLevel.Fatal:
                    log.Fatal(message);
                    break;
                case LogLevel.Off:
                    break;
                default:
                    break;
            }

            Debug.WriteLine(message);
        }
    }

    public enum LogLevel
    {
        All,
        Debug,
        Info,
        Warn,
        Error,
        Fatal,
        Off
    }
}
